package cn.anyubao.blog.exception;

/**
 * 基础异常处理类
 *
 * @author huqilang
 */
public class BusinessException extends RuntimeException {

    private static final long serialVersionUID = 842879598196140622L;
    private final int code;
    private final String msg;

    public BusinessException(int code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public BusinessException(int code, Throwable e) {
        super(e.getMessage(), e);
        this.code = code;
        this.msg = e.getMessage();
    }

    public BusinessException(int code, String msg, Throwable e) {
        super(e.getMessage(), e);
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return this.code;
    }

    public String getMsg() {
        return this.msg;
    }
}
